var http = require("http");
var fs = require("fs");
var data = [];
var server = http.createServer(function(req,res){
	fs.readFile("reg.html",function(err,data){
		res.setHeader("Content-Type","text/html");
		res.end(data);
	});
	var str = req.url.split("?");
        str = str[1];
        var arr = str.split("&"); 
        var one = {};
        arr.forEach(function(o){
           var s = o.split("=");
           one[s[0]]=s[1];
        });
        data.push(one);
        console.log(data);
	res.setHeader("Content-Type","text/html");
	res.end("注册用户:" + data);
	


});
server.listen(4000);
